<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="http://www.cnboy.top/Forfun/Bootstrap/css/bootstrap.min.css">
    <script src="http://www.cnboy.top/Forfun/Bootstrap/js/jquery.min.js"></script>
    <script src="http://www.cnboy.top/Forfun/Bootstrap/js/popper.min.js"></script>
    <script src="http://www.cnboy.top/Forfun/Bootstrap/js/bootstrap.min.js"></script>
    <title>Blog首页</title>
</head>
<body>
<div class="jumbotron text-center" style="margin-bottom:0">
    <h1>Blog首页</h1>
</div>

<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
    <a class="navbar-brand" href="index.php">首页</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="collapsibleNavbar">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="#">链接</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">链接</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">链接</a>
            </li>
        </ul>
    </div>
</nav>

<div class="container" style="margin-top:30px">
    <div class="row">
        <div class="col-sm-4">
            <h2>栏目</h2>
            <ul>
                <?php foreach($cats as $c) {?>
                <li><a href="index.php?cat_id=<?php echo $c['cat_id']; ?>"><?php echo $c['cat_name']; ?></a> </li>
                <?php } ?>
            </ul>
            <h3>一些链接</h3>
            <p>说明文本</p>
            <ul class="nav nav-pills flex-column">
                <li class="nav-item">
                    <a class="nav-link active" href="#">激活状态</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">链接</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">链接</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link disabled" href="#">禁用</a>
                </li>
            </ul>
            <hr class="d-sm-none">
        </div>
        <div class="col-sm-8">
            <div class="container">
                <h2 class="text-center"><?php echo $art['title']; ?></h2>
                <span><time><?php echo date('Y/m/d',$art['pubtime']); ?></time><span>   by <?php echo $art['author']; ?></span><span> <?php echo $art['cat_name'];?></span><span class="badge badge-primary">!</span><span> <?php echo $art['comm'];?>条评论</span></span>
               <?php if ($art['pic']){ ?>
                <div class="container">
                    <img style="width: 100%;height: 400px;" src="./<?php echo $art['pic'];?>" alt="">
               </div>
                <?php  }?>
                <div class="card" style="height: 500px;">
                    <artile>
                        <?php echo $art['content'];?>
                    </artile>
                </div>
            </div>
            <div class="container">
                comments as you can see
                <?php foreach($comms as $c) { ?>
                <div class="card">
                    <span><h5 style="color: deepskyblue;"><?php echo $c['nick'];?></h5><span class="badge badge-primary"><?php echo date('Y/m/d',$c['pubtime']);?></span><p><?php echo $c['content'];?></p></span>
                </div>
                <?php } ?>
            </div>
            <div class="container text-center">
                <div class="card">
                    <h3>留言</h3>
                    <?php if(isset($rs) && ($rs == false)) {?>
                    <div class="alert alert-danger">
                        <strong>留言失败!</strong>
                    </div>
                    <?php } ?>
                <form action="" method="post">
                    <input type="text" placeholder="your name" name="nick" id="nick"><br>
                    <input type="text" placeholder="your email" name="email" id="email"><br>
                    <textarea name="content" id="content" cols="30" rows="10" placeholder="your comment"></textarea><br>
                    <input type="submit" value="submit" class="btn btn-info">
                </form>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="jumbotron text-center" style="margin-bottom:0">
    <p>底部内容</p>
</div>
</body>
</html>